/* eslint-disable max-classes-per-file */
/*
 * @Description:
 * @Version: 2.0
 * @Autor: wiz
 * @Date: 2023-08-16 17:36:20
 * @LastEditors: swc
 * @LastEditTime: 2024-06-03 17:02:16
 */
import { N_oSetupPanel } from '../../types';
import { T_compPanelConf } from '../compConfPanel';
import { T_compBase } from './compBase';

type I_messageConf = N_oSetupPanel.N_comps.I_messageConf;
export class T_reportChartConf {
  name: string;

  comment: string;

  isCreated: boolean;

  status: string;

  reportChartCode: string;

  chartMode: string;

  messageConfig: I_messageConf;
}

export class T_reportChart extends T_compBase {
  private TcompPanelConf: T_compPanelConf = new T_compPanelConf();

  public conf: T_reportChartConf = new T_reportChartConf();

  constructor() {
    super();
    this.conf = {
      name: '',
      comment: '',
      isCreated: false,
      status: '',
      reportChartCode: null,

      chartMode: '',

      messageConfig: {
        custDefListener: {
          search: [],
          coordination: null
        },
        emitActions: {
          search: [],
          refresh: []
        },
        eventGroup: null
      }
    };
  }

  public getPermissionList(): Array<N_oSetupPanel.I_permission> {
    return [];
  }

  public getComponentId(): N_oSetupPanel.N_comps.COMP_MODULE_ID {
    return N_oSetupPanel.N_comps.COMP_MODULE_ID.REPORT_CHART;
  }

  public getConf(): T_reportChartConf {
    return this.conf;
  }

  public GetCompPanelConf(): N_oSetupPanel.N_comps.I_setupPanel {
    return this.TcompPanelConf.getCompPanelSet(
      N_oSetupPanel.N_comps.COMP_NAME.REPORT_CHART
    );
  }
}
